package com.ht.temp.service.impl;

import com.ht.temp.entity.AlertReport;
import com.ht.temp.mapper.AlertReportMapper;
import com.ht.temp.service.IAlertReportService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author mayke_zhou
 * @since 2018-12-26
 */
@Service
@Transactional
public class AlertReportServiceImpl extends ServiceImpl<AlertReportMapper, AlertReport> implements IAlertReportService {
    @Autowired
    private  AlertReportMapper alertReport;

    @Override
    public List<AlertReport> selectByAlertReport(AlertReport report,@Param("pageBegin") Integer pageBegin) {
        return alertReport.selectByAlertReport(report,pageBegin);
    }

    @Override
    public Integer selectCountByPage(AlertReport report) {
        return alertReport.selectCount(report);
    }

    @Override
    public List<AlertReport> getAlertReportByDay(String time, Integer devcieId) {
        String start = time+" 00:00:00";
        String end = time+" 23:59:59";
        return alertReport.selectAlertByDay(start,end,devcieId);
    }
}
